package com.whmskj.xjlhsc.mobie.ProductionManagement.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.mobie.ProductionManagement.service.imp.EnergyConsumptionOfFineSandProductionServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;

/**
 * @author jiaruchun
 * @date 2025-08-27 09:47
 */
@SaIgnore
@RestController
@CrossOrigin
@Api(tags = "细砂产量能耗接口")
@RequestMapping("/mobile/ProductionManagement/EnergyConsumptionOfFineSandProduction")
public class EnergyConsumptionOfFineSandProductionController {

    @Autowired
    private EnergyConsumptionOfFineSandProductionServiceImpl energyConsumptionOfFineSandProductionService;

    @ApiOperation(value = "查询细砂日产量能耗列表",notes = "")
    @GetMapping("/day")
    public Result getEnergyConsumptionOfFineSandProductionListByDay(@RequestParam("time") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate time) {
        return Result.success(energyConsumptionOfFineSandProductionService.getEnergyConsumptionOfFineSandProductionListByDay(time));
    }

    @ApiOperation(value = "查询细砂月产量能耗列表",notes = "")
    @GetMapping("/month")
    public Result getEnergyConsumptionOfFineSandProductionListByMonth(@RequestParam("monthStr") String monthStr) {
        return Result.success(energyConsumptionOfFineSandProductionService.getEnergyConsumptionOfFineSandProductionListByMonth(monthStr));
    }

    @ApiOperation(value = "查询细砂班产量能耗列表",notes = "")
    @GetMapping("/shift")
    public Result getEnergyConsumptionOfFineSandProductionListByShift(@RequestParam("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
                                                                      @RequestParam("DayShiftOrEveningShift") String DayShiftOrEveningShift) {
        return Result.success(energyConsumptionOfFineSandProductionService.getEnergyConsumptionOfFineSandProductionListByShift(date,DayShiftOrEveningShift));
    }

    @ApiOperation(value = "查询细砂品种产量能耗列表",notes = "")
    @GetMapping("/variety")
    public Result getEnergyConsumptionOfFineSandProductionListByVariety(@RequestParam("monthStr") String monthStr) {
        return Result.success(energyConsumptionOfFineSandProductionService.getEnergyConsumptionOfFineSandProductionListByVariety(monthStr));
    }
}
